]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Close messages on clear
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 11 Mar 2015 21:20:21 +0000 (22:20 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 12 Mar 2015 16:10:11 +0000 (17:10 +0100)
Currently the clear action in the section header simply removes all
messages from the section. While the result looks exactly as if the
close button of each individual message had been clicked, the messages
are not actually closed - after a restart (or some other condition that
triggers a reload), the messages simply reappear, which is confusing.
Do the expected thing instead, and make clear close all messages in the
section.

https://bugzilla.gnome.org/show_bug.cgi?id=746027

js/ui/calendar.js

index dda733c7c18494c8d5c63d6d58064042aab0a307..93d5e7d3b949e22f16a9a6cc8ea79607dfe3bda9 100644 (file)
@@ -1382,8 +1382,9 @@ const MessageListSection = new Lang.Class({
 
         // If there are few messages, letting them all zoom out looks OK
         if (messages.length < 2) {
-            messages.forEach(Lang.bind(this, function(message) {
-                this.removeMessage(message, true); }));
+            messages.forEach(function(message) {
+                message.close();
+            });
         } else {
             // Otherwise we slide them out one by one, and then zoom them
             // out "off-screen" in the end to smoothly shrink the parent
@@ -1397,9 +1398,9 @@ const MessageListSection = new Lang.Class({
                                    time: MESSAGE_ANIMATION_TIME,
                                    delay: i * delay,
                                    transition: 'easeOutQuad',
-                                   onComplete: Lang.bind(this, function() {
-                                       this.removeMessage(message, true);
-                                   })});
+                                   onComplete: function() {
+                                       message.close();
+                                   }});
             }
         }
     },